let arr = [1, 2, 3, 4, 5, 6];
let ar = [];

let a = document.querySelector('#a');
a.innerHTML = arr;

let b = document.querySelector('#b');
b.innerHTML = ar;

let c = document.querySelector('#c');
c.addEventListener('click', function () {
  let num = Math.floor(Math.random() * arr.length);
  a.innerHTML = arr;
  b.innerHTML = ar;

  if (arr.length) {
    let x = arr.splice(num, 1);
    ar.push(x);
  } else {
    a.innerHTML = arr;
    b.innerHTML = ar;
    alert('没了哦');
    return;
  }
})